#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>

void* my_memmove(void* str1, const void* str2, size_t n)
{
	assert(str1 && str2);
	void* ret = str1;
	if (str1 < str2)
	{
		while (n--)
		{
			*((char*)str1) = *((char*)str2);
			(char*)str1 += 1;
			(char*)str2 += 1;
		}
	}
	else
	{
		while (n--)
		{
			*((char*)str1 + n) = *((char*)str2 + n);
		}
	}
	return ret;
}
int main()
{
	char arr1[20] = "abcdefghi";
	printf("%s\n", (char*)my_memmove(arr1+1, arr1, 5));
	printf("%s\n", arr1);

	return 0;
}